package com.broada.apm.indicator.api.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;

import com.broada.apm.dao.UserDao;
import com.broada.apm.indicator.api.UserService;
import com.broada.apm.model.PagingList;
import com.broada.apm.model.User;
import com.broada.apm.model.UserToken;

public class UserServiceImpl implements UserService {

	@Autowired
	private UserDao userDao;
	
	@Override
	public void addUser(User user) {
		userDao.addUser(user);
	}

	@Override
	public void updateUserPassword(String id, String password) {
		userDao.updateUserPassword(id, password);
	}

	@Override
	public void updateUserNameAndRole(String id, String name, int role) {
		userDao.updateUserNameAndRole(id, name, role);
	}

	@Override
	public void updateUserStatus(String id, int status) {
		userDao.updateUserStatus(id, status);
	}

	@Override
	public void deleteUser(User user) {
		userDao.deleteUser(user);
	}

//	@Override
//	public List<User> getAllUsers() {
//		return userDao.getAllUsers();
//	}

	@Override
	public User getUserById(String userId) {
		return userDao.getUserById(userId);
	}

	@Override
	public PagingList<User> getPagingUser(int pageIndex, int pageSize) {
		return userDao.getPagingUser(pageIndex, pageSize);
	}

	@Override
	public User getUserByAccount(String account) {
		return userDao.getUserByAccount(account);
	}

	@Override
	public void deleteUserToken(String key) {
		userDao.deleteUserToken(key);
	}

	@Override
	public UserToken getUserToken(String key) {
		return userDao.getUserToken(key);
	}

	@Override
	public List<UserToken> getAllUserTokens() {
		return userDao.getAllUserTokens();
	}

	@Override
	public void addUserToken(UserToken userToken) {
		userDao.addUserToken(userToken);
	}

}
